export default {
  ensureDefault: function(json, attribute, value) {
    // eslint-disable-next-line no-prototype-builtins
    if (!json.hasOwnProperty(attribute)) {
      json[attribute] = value;
    }
  },

  flatDiff(obj1, obj2) {
    var result = {};
    for (let key in obj1) {
      if (obj1[key] !== obj2[key]) {
        result[key] = obj1[key];
      }
    }
    return result;
  }
};
